package bean;

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;

import java.util.ArrayList;

public class TimeArrayBean implements Parcelable,Comparable<TimeArrayBean> {

    public int title=0; //0 是星期天  6 是星期六
    public ArrayList<String> arrs=new ArrayList<String>();//每一天开启录像时间的数组
    public boolean  mIsAllDay=false;

    public TimeArrayBean() {
    }

    public TimeArrayBean(int title, ArrayList<String> arrs) {
        this.title = title;
        this.arrs = arrs;
    }

    protected TimeArrayBean(Parcel in) {
        title = in.readInt();
        arrs = in.createStringArrayList();
        mIsAllDay = in.readByte() != 0;
    }


    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public ArrayList<String> getArrs() {
        return arrs;
    }

    public void setArrs(ArrayList<String> arrs) {
        this.arrs = arrs;
    }

    public boolean ismIsAllDay() {
        return mIsAllDay;
    }

    public void setmIsAllDay(boolean mIsAllDay) {
        this.mIsAllDay = mIsAllDay;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(title);
        dest.writeStringList(arrs);
        dest.writeByte((byte) (mIsAllDay ? 1 : 0));
    }

    public static final Creator<TimeArrayBean> CREATOR = new Creator<TimeArrayBean>() {
        @Override
        public TimeArrayBean createFromParcel(Parcel in) {
            return new TimeArrayBean(in);
        }

        @Override
        public TimeArrayBean[] newArray(int size) {
            return new TimeArrayBean[size];
        }
    };

    @Override
    public int compareTo(@NonNull TimeArrayBean o) {
        return this.title-o.title;
    }
}
